<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>垂直地画一个字符</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.imagechar.html">imagechar</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.imagecolorallocate.html">imagecolorallocate</a></div>
 <div class="up"><a href="ref.image.html">GD and Image 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.imagecharup" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagecharup</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">imagecharup</span> &mdash; <span class="dc-title">垂直地画一个字符</span></p>

 </div>
 <div class="refsect1 unknown-unknown-unknown-seealsr" id="refsect1-function.imagecharup-unknown-unknown-unknown-seealsr">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>imagecharup</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$image</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$font</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$x</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$y</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$c</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$color</code></span>
   )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>imagecharup()</strong></span> 将字符
   <em><code class="parameter">c</code></em> 垂直地画在
   <em><code class="parameter">image</code></em> 指定的图像上，位于
   <em><code class="parameter">x</code></em>，<em><code class="parameter">y</code></em>（图像左上角为 0, 0），颜色为
   <em><code class="parameter">color</code></em>。如果 <em><code class="parameter">font</code></em>
   为 1，2，3，4 或 5，则使用内置的字体。
  </p>
  <p class="para">
   <div class="example" id="example-3121">
    <p><strong>Example #1 <span class="function"><strong>imagecharup()</strong></span> 例子</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$im&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecreate</span><span style="color: #007700">(</span><span style="color: #0000BB">100</span><span style="color: #007700">,</span><span style="color: #0000BB">100</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$string&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'Note&nbsp;that&nbsp;the&nbsp;first&nbsp;letter&nbsp;is&nbsp;a&nbsp;N'</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$bg&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">255</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">255</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">255</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$black&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;prints&nbsp;a&nbsp;black&nbsp;"Z"&nbsp;on&nbsp;a&nbsp;white&nbsp;background<br /></span><span style="color: #0000BB">imagecharup</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">10</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">10</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$string</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$black</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type:&nbsp;image/png'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagepng</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
  <p class="para">
   参见 <span class="function"><a href="function.imagechar.html" class="function">imagechar()</a></span> 和
   <span class="function"><a href="function.imageloadfont.html" class="function">imageloadfont()</a></span>。
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.imagechar.html">imagechar</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.imagecolorallocate.html">imagecolorallocate</a></div>
 <div class="up"><a href="ref.image.html">GD and Image 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
